<template>
    <page-container>
        <cu-custom slot="header" bgColor="bg-white" :isBack="true">
            <block slot="backText"></block>
            <block slot="content">申请</block>
        </cu-custom>

        <view slot="center" class="content">
            <image :src="$util.imgPath(`${status?'enterprise-purchase-fail.png':'enterprise-purchase-audit.png'}`)" class="status-image">
                <view class="tipBox">
                    <view class="tip">您的企业购会员申请</view>
                    <view v-if="status ==0">正在审核中，请稍后...</view>

                    <block v-if="status ==2">
                        <view>未通过，请重新提交信息</view>
                        <view class="cause">拒绝原因：统一社会信用代码/纳税人识别号错误.</view>
                        <button class="affirm" @click="affirm()">重新提交</button>
                    </block>

                </view>
        </view>

    </page-container>
</template>

<script>
export default {
	data() {
		return {
			status: 0 // 0 审核中  2失败
		}
	},

	onShow() {
		this.getCompanyStatus()
	},
	methods: {
		getCompanyStatus() {
			this.$request.getCompanyStatus().then(res => {
				console.log(res)
				if (res.code == 0) {
					this.status = res.data.corp_status
				}
			})
		},
		affirm() {
			this.$util.redirectTo('/subpackage/enterprisePurchase/enterprisePurchase')
		}
	}
}
</script>

<style lang="scss" scoped>
.content {
    background: #fff;
    height: 100%;
    padding-top: 87rpx;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.status-image {
    width: 320rpx;
    height: 197rpx;
}
.tipBox {
    width: 100%;
    text-align: center;
    margin-top: 53rpx;
}
.tip {
    font-size: 36rpx;
    font-family: PingFang SC;
    font-weight: 800;
}
.cause {
    margin-top: 56rpx;
    font-size: 28rpx;
    font-family: PingFang SC;
    font-weight: 500;
    color: #999999;
}
.affirm {
    background-color: #ffd332;
    height: 96rpx;
    line-height: 96rpx;
    font-size: 32rpx;
    border-radius: 100rpx;
    color: #fff;
    margin-top: 188rpx;
}
</style>
